<template>
    <div class="table">
       <q-table
       title="Treats"
      :data="data"
      :columns="columns"
      row-key="name"
     :selected.sync="selected"
     height="100%"
     style="height:100%"
    >

<slot>
  </slot>
  
<template v-slot:body-cell="props"> 
         <q-td :props="props">
          <q-badge color="blue" :label="props.value" v-if="props.value !== '查看报告'" />
<!-- {{props}} -->
     <q-btn color="blue" label="查看报告2" @click="btn(props)" v-if="props.value == '查看报告'" />
        </q-td>
      </template>

</q-table> 

<pdfs :data="data" v-if="showshow" @close="close"></pdfs>

    </div>
</template>

<script>
// import pdf from 'vue-pdf'
// import CMapReaderFactory from 'vue-pdf/src/CMapReaderFactory.js'
// import Moveable from 'vue-moveable';
import pdfs from './pdf'

export default {
  name: 'tables',

    data(){
        return {
          showshow:false,

            selected:[],

        }
    },
    props:['data','columns'],
    components:{pdfs},
    methods:{

      btn(e){
        console.log('点击了',e);
        // this.showshow = true
        this.$router.push({
          path:'/pdfItem'
          
        })
      },

//关闭弹框
close(){
    this.showshow = false
}


    },
    mounted(){
      console.log(this.data);

    }
}
</script>

<style scoped lang="less">

.table{
  width: 100%;
  height: 100%;
}


</style>